package com.qdy.service.impl;

import com.qdy.repository.VenueCardRepository;
import com.qdy.repository.VenueRepository;
import com.qdy.service.VenueServicer;
import com.qdy.dto.VenueDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by qudingyi on 2017/4/22.
 */
@Service
public class VenueServiceImpl implements VenueServicer {
    @Autowired
    private VenueRepository venueRepository;

    @Autowired
    private VenueCardRepository venueCardRepository;


    @Override
    public VenueDto getVenueInfo(Long venuId) {
        VenueDto venueViwe=new VenueDto();
        venueViwe.setVenuel(venueRepository.findOne(venuId));

        venueViwe.setVenueCards(venueCardRepository.findByVenueIdOrderByCreateTimeDesc(venuId));
        return venueViwe;
    }
}
